package org.jiamandan.com.strategy.impl.tram.listener;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import io.netty.channel.Channel;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.jiamandan.com.constant.BizConstant;
import org.jiamandan.com.dto.ZDBasicDto;
import org.jiamandan.com.strategy.impl.tram.IZDListenerService;
import org.jiamandan.com.utils.CommonUtil;
import org.springframework.stereotype.Service;

/**
 * @version Revision 1.0.1
 * @版权：版权所有 (c) 2021
 * @see:
 * @创建日期：2022-12-12 14:00
 * @功能说明： JMD-YD下发修改充电时间应答

 * @begin
 * @修改记录:
 * @修改后版本 修改人        修改内容
 * @2022-12-01 16:50	        CWJ       	创建
 * @end
 */
@Service(value = BizConstant.CmdClass.CMD_JSY_A0_SERVICE)
@AllArgsConstructor
@Slf4j
public class JSYIssueChargeAddressListenerService implements IZDListenerService {

    @Override
    public void doExecute(ZDBasicDto dto, Channel client) throws Exception {
        String deviceNo = StrUtil.toString(Integer.parseInt(CommonUtil.reverseHex(dto.getDeviceNo()).substring(2), 16));
        String data = dto.getData();
        log.info("接收JMD-JSY更新连接地址设备应答报文(CMD=a0)【"+deviceNo+"】报文:" + JSON.toJSONString(dto));
    }
}
